<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<f:view>

	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<meta http-equiv="Expires" content="-1" />
		<meta http-equiv="Cache-Control"
			content="no-cache, no-store, max-age=0, must-revalidate" />
		<meta http-equiv="Pragma" content="no-cache" />
		<h:outputStylesheet library="css" name="style.css" />
		<h:outputScript library="js" name="menu.js" target="head" />
		<title>HSM Proxy Administrator Web Application</title>
	</h:head>

	<h:body>
		<div id="header">
			<h1>HSM Proxy Administrator Web Application</h1>
		</div>

		<div style="position: relative;">

			<div id="content">
				<h2>
					<ui:insert name="title">Default Title</ui:insert>
				</h2>
				<p:messages id="messages" globalOnly="true" />
				<ui:insert name="body">
					<p>Default Body</p>
				</ui:insert>
			</div>

			<div id="menu">
				<h:form>
					<p:menu>
						<p:menuitem value="Key Stores"
							action="#{hsmProxyMenu.nav('/admin/key-stores.xhtml')}"
							ajax="false" onclick="selectMenuitemLink(this);"
							styleClass="#{hsmProxyMenu.getMenuitemStyleClass('/admin/key-store')}" />
						<p:menuitem value="Applications"
							action="#{hsmProxyMenu.nav('/admin/applications.xhtml')}"
							ajax="false" onclick="selectMenuitemLink(this);"
							styleClass="#{hsmProxyMenu.getMenuitemStyleClass('/admin/application')}" />
						<p:menuitem value="Audit"
							action="#{hsmProxyMenu.nav('/admin/audit.xhtml')}" ajax="false"
							onclick="selectMenuitemLink(this);"
							styleClass="#{hsmProxyMenu.getMenuitemStyleClass('/admin/audit')}" />
						<p:menuitem value="Security Audit"
							action="#{hsmProxyMenu.nav('/admin/security-audit.xhtml')}"
							ajax="false" onclick="selectMenuitemLink(this);"
							styleClass="#{hsmProxyMenu.getMenuitemStyleClass('/admin/security-audit')}" />
						<p:menuitem value="Privileges"
							action="#{hsmProxyMenu.nav('/admin/privileges.xhtml')}"
							ajax="false" onclick="selectMenuitemLink(this);"
							styleClass="#{hsmProxyMenu.getMenuitemStyleClass('/admin/privileges')}" />
						<p:menuitem value="About"
							action="#{hsmProxyMenu.nav('/admin/about.xhtml')}" ajax="false"
							onclick="selectMenuitemLink(this);"
							styleClass="#{hsmProxyMenu.getMenuitemStyleClass('/admin/about')}" />
					</p:menu>
				</h:form>
			</div>

			<div id="login">
				<p:panel header="Welcome #{hsmProxyAuthentication.name}"
					rendered="#{hsmProxyAuthentication.loggedIn}"
					style="margin-left: 10px;">
					<h:form>
						<h:panelGrid columns="2">
							<h:outputText value="Card number:" />
							<h:outputText value="#{hsmProxyAuthentication.cardNumber}" />
						</h:panelGrid>
						<p:commandButton value="Logout"
							action="#{hsmProxyAuthentication.logout}" ajax="false" />
					</h:form>
				</p:panel>
			</div>

		</div>

	</h:body>

</f:view>

</html>